import {useLocation} from 'react-router-dom';

const usePathname = () => {
    const location = useLocation();
    const [firstLevel, secondLevel] = location.pathname.split('/').filter(Boolean);

    return {
        firstLevel,
        secondLevel
    };
};

export default usePathname;
